package cn.edu.scau.cmi.hexiaoqing.composite.safe;

import java.util.ArrayList;
public class Group implements ConsistentComponent {
	private String name;
	private ArrayList<ConsistentComponent> children = new ArrayList<ConsistentComponent>();

	public Group(String name) {
		this.name = name;
	}
	public String getInf() {
		String inf = "The group: " + name + "\n";
		for (ConsistentComponent child : children) {
			inf += "\t" + child.getInf() + "\n";
		}
		return inf;
	}
	public void add(ConsistentComponent child) {
		children.add(child);
	}
	public void remove(ConsistentComponent child) {
		children.remove(child);
	}
	public String getName() {
		return name;
	}
}

